package mysql

import "gorm.io/gorm"

type User struct { //用户表
	gorm.Model
	Account  string `gorm:"type:varchar(30);not null"`
	Password string `gorm:"type:char(32);not null"`
	Image    string `gorm:"type:varchar(300);not null"`
	Name     string `gorm:"type:varchar(30);not null"`
}
type Product struct { //商品表
	gorm.Model
	Title   string  `gorm:"type:varchar(30);not null"`
	Price   float64 `gorm:"type:decimal(10,2);not null"`
	Stock   int64   `gorm:"type:varchar(30);not null"`
	UserId  int64   `gorm:"type:int(11);not null"`
	ClassId int64   `gorm:"type:int(11);not null"`
}
type Evaluate struct { //评价表
	gorm.Model
	ProductId int64  `gorm:"type:int(11);not null"`
	Content   string `gorm:"type:varchar(300);not null"`
}
type Collect struct { //收藏表
	gorm.Model
	UserId    int64 `gorm:"type:int(11);not null"`
	ProductId int64 `gorm:"type:int(11);not null"`
}
type Class struct { //分类表
	gorm.Model
	Name string `gorm:"type:varchar(30);not null"`
}

type UserData struct {
	Product
}
